﻿<Serializable()> _
Public Class clsNotificationKeys
	Inherits clsBaseClass

	Private booCapsLock As Boolean
	Private booAltKey As Boolean
	Private booCtrlKey As Boolean
	Private booNumLock As Boolean
	Private booScrollLock As Boolean
	Private booShiftKey As Boolean

	Public Property CapsLock() As Boolean
		Get
			Return booCapsLock
		End Get
		Set(ByVal value As Boolean)
			booCapsLock = value
		End Set
	End Property

	Public Property AltKey() As Boolean
		Get
			Return booAltKey
		End Get
		Set(ByVal value As Boolean)
			booAltKey = value
		End Set
	End Property

	Public Property CtrlKey() As Boolean
		Get
			Return booCtrlKey
		End Get
		Set(ByVal value As Boolean)
			booCtrlKey = value
		End Set
	End Property

	Public Property NumLock() As Boolean
		Get
			Return booNumLock
		End Get
		Set(ByVal value As Boolean)
			booNumLock = value
		End Set
	End Property

	Public Property ScrollLock() As Boolean
		Get
			Return booScrollLock
		End Get
		Set(ByVal value As Boolean)
			booScrollLock = value
		End Set
	End Property

	Public Property ShiftKey() As Boolean
		Get
			Return booShiftKey
		End Get
		Set(ByVal value As Boolean)
			booShiftKey = value
		End Set
	End Property

	Public Function GetResult() As Boolean
		If AltKey = False And CapsLock = False And CtrlKey = False And _
		NumLock = False And ScrollLock = False And ShiftKey = False Then Return False

		If AltKey And My.Computer.Keyboard.AltKeyDown = False Then Return False
		If CapsLock And My.Computer.Keyboard.CapsLock = False Then Return False
		If CtrlKey And My.Computer.Keyboard.CtrlKeyDown = False Then Return False
		If NumLock And My.Computer.Keyboard.NumLock = False Then Return False
		If ScrollLock And My.Computer.Keyboard.ScrollLock = False Then Return False
		If ShiftKey And My.Computer.Keyboard.ShiftKeyDown = False Then Return False

		Return True
	End Function

	Public Overrides Sub GetObjectData(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
		MyBase.GetObjectData(info, context)
		info.AddValue("AltKey", AltKey)
		info.AddValue("CtrlKey", CtrlKey)
		info.AddValue("ShiftKey", ShiftKey)
		info.AddValue("CapsLock", CapsLock)
		info.AddValue("NumLock", NumLock)
		info.AddValue("ScrollLock", ScrollLock)
	End Sub
End Class
